<template>
	<view class="PT_2">
		<view class="bg_fff P_2">
			<view class="font_weight_bold P_2 line_bom">
				账号：{{name}}
			</view>
			<view @click="uOpenWin('../heyue/zhuDet?info='+JSON.stringify(item))" class="PTB_2 PLR_2 line_bom" v-for="(item,i) in cangList" :key='i'>
				<view class="flex_row_between">
					
					<view 
						:class="item.action_code==1?'color_up':'color_down'"
						 class="font_weight_bold fontS_16 flex_rowL"
					>
						<view >
							{{item.action_code==1?'撮涨':'撮跌'}}
						</view>
						<view class="PL_1 pub_color">
							{{item.action_money}}
						</view>
						<view class="fontS_10 pub_color PR_1" style="padding-top: 0.8vw;">
							KSA
						</view>
						<view class="">
							{{item.status_text}}
						</view>
					</view>
					
					
					<view 
					:class="item.action_code==1?'color_up':'color_down'"
					class="font_weight_bold fontS_16 flex_rowL">
						{{item.bonus}}
						<view class="fontS_10 pub_color PR_1" style="padding-top: 0.8vw;">
							KSA
						</view>
					</view>
				</view>
				
				<view class="flex_row_between color_gray">
					<view class="fontS_10 color_gray">
						{{item.issue && item.issue.start_price}}
						-
						{{item.issue && item.issue.end_price}}
					</view>
					<view class="font_weight_bold">
						币种：{{item.base_currency.toUpperCase()}}
					</view>
				</view>
				<view class="flex_row_between color_gray">
					<view class="fontS_10 color_gray">
						{{item.start_time}}
					</view>
					<view class="fontS_10">
						{{item.end_time}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cangList:[],
				page:1,
				showText:'',
				state:true,
				name:'',
				id:''
			}
		},
		onLoad(options) {
			this.name = options.name;
			this.id = options.id;
			this.getList();
			
		},
		onReachBottom() {
			if (this.state) {
				this.showTxt = '加载中...';
				this.page++
				this.getList();
			}
		},
		onPullDownRefresh() {
			//this.getSorts();
			// this.getInfo()
			this.getList();
			console.log('refresh');
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		methods: {
			getList(){
				let _this = this;
				this.$req('bet/index',{page:_this.page,user_id:_this.id},(res)=>{
					if(res.code==1){
						if(res.data.list && res.data.list.length>0){
							if(_this.page==1){
								_this.cangList = res.data.list;
							}else{
								_this.cangList = _this.list.concat(res.data.list)
							}
						}else{
							_this.showText = '没有更多了';
							_this.state = false;
						}
					}else{
						_this.toast(res.msg)
					}
				})
			},
		}
	}
</script>

<style>

</style>
